#!/usr/bin/python2
# -*- coding: utf-8 -*
"""
 4生成动态参数 int,double,bool,string,列表
 5实现流程:
 6    1.导包
 7    2.创建生成器
 8    3.向生成器添加若干参数
 9    4.生成中间文件并退出
10
"""
# 1.导包
from dynamic_reconfigure.parameter_generator_catkin import *

PACKAGE = "my_odom"
# 2.创建生成器
gen = ParameterGenerator()

# 3.向生成器添加若干参数
# add(name, paramtype, level, description, default=None, min=None, max=None, edit_method="")
gen.add("odom_icp_max_iteration", int_t, 0, "odom_icp_max_itr", 500, 100, 1000)

# gen.add("odom_icp",double_t,0,"浮点参数",1.57,0,3.14)
#  gen.add("string_param",str_t,0,"字符串参数","hello world ")
#  gen.add("bool_param",bool_t,0,"bool参数",True)
#
#  many_enum = gen.enum([gen.const("small",int_t,0,"a small size"),
#                  gen.const("mediun",int_t,1,"a medium size"),
#                  gen.const("big",int_t,2,"a big size")
#                  ],"a car size set")
#
#  gen.add("list_param",int_t,0,"列表参数",0,0,2, edit_method=many_enum)

# 4.生成中间文件并退出
exit(gen.generate(PACKAGE, "dr_node", "dr"))
